﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace MyPSDALayer
{
    [MetadataType(typeof(ArticleMetaData))]
    public partial class Article
    {
        private class ArticleMetaData
        {
            [Required(ErrorMessage = "文章标题不能为空")]
            [Display(Name = "文章标题")]
            public string ArticleName { get; set; }
            [Display(Name = "文章分类")]
            public string TypeName { get; set; }
            [Required(ErrorMessage = "文章内容不能为空")]
            [Display(Name = "文章内容")]
            public string ArticleContent { get; set; }
            [Required(ErrorMessage = "请选择")]
            [Display(Name = "是否显示到首页")]
            public string ISIndex { get; set; }
            [Display(Name = "阅读次数")]
            public int ReadCount { get; set; }
            [Required(ErrorMessage = "请选择")]
            [Display(Name = "是否置顶")]
            public string ISTop { get; set; }
            [Display(Name = "摘要")]
            [Required(ErrorMessage = "不能为空")]
            public string Summary { get; set; }
            [Display(Name = "封面")]
            [FileFormat("jpg")]
            public string CoverUrl { get; set; }
            [Required(ErrorMessage = "请选择")]
            [Display(Name = "是否为淘宝日记")]
            public string ISTaobao { get; set; }
            [Required(ErrorMessage = "请选择")]
            [Display(Name = "是否为热门资讯")]
            public string ISHot { get; set; }
            public string CreateBy { get; set; }
            public Nullable<System.DateTime> CreateDate { get; set; }
            public string ModifyBy { get; set; }
            public Nullable<System.DateTime> ModifyDate { get; set; }
        }
    }
}